<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<h:head>
	<title>Employees</title>
</h:head>
<h:body>
	<h:form prependId="false">
		<p:panel header="Search By Dept"> Select Country :
			<h:selectOneMenu value="#{ajaxEmployeeBean.selectedDept}">
				<f:selectItems value="#{deptBean.allDepts}" />
			</h:selectOneMenu>

			<p:separator />

			<p:commandButton action="#{ajaxEmployeeBean.performSearch}" value="Search" update="empTable" />

			<p:dataTable id="empTable" value="#{ajaxEmployeeBean.searchResults}" var="emp">
				<f:facet name="header">
					<h:outputText value="Employees search results for " />
					<h:outputText value="#{ajaxEmployeeBean.selectedDept}" />
					<h:outputText value=" Dept" />
				</f:facet>
				<p:column>
					<f:facet name="header">
						<h:outputText value="Id" />
					</f:facet>
					<h:outputText value="#{emp.id}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="Name" />
					</f:facet>
					<h:outputText value="#{emp.name}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="Dept" />
					</f:facet>
					<h:outputText value="#{emp.dept}" />
				</p:column>
			</p:dataTable>
		</p:panel>
	</h:form>
</h:body>
</html>